<% layout('/layouts/default.html', {title: '广告获客管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('广告获客详情')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${adGuest}" action="${ctx}/ad/adGuest/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<#form:hidden path="adId" />
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('广告计划名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="ad.name" maxlength="300" class="form-control"  readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('广告主')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="adVertiser.account" maxlength="64" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('联系电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mobile" maxlength="20" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('号码归属')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mobileLocation" maxlength="255" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('性别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="sex" dictType="sys_user_sex" blankOption="true" class="form-control" disabled="disabled"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('手机型号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mobileKind" maxlength="64" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('年龄')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="age" maxlength="2" class="form-control digits" readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('职业')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="career" maxlength="100" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('投放媒体')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="comeFrom" maxlength="64" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('获客时间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="guestTime" readonly="true" maxlength="20" class="form-control Wdate"
									dataFormat="datetime"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<!-- <div class="col-xs-6" id="consumDiv">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('消费')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="consumptionStatus" dictType="consumption_status" multiple="false" blankOption="true" class="form-control" />
							</div>
						</div>
					</div> -->
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('媒体页URL')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mediaUrl" readonly="true" maxlength="255" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('广告位ID')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mediaAdId" readonly="true" maxlength="255" class="form-control" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('落地页URL')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="toGroundUrl" readonly="true" maxlength="255" class="form-control" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('停留时间(秒)')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="stopTime" readonly="true" maxlength="11" class="form-control digits" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('留言内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="message" readonly="true" rows="4" maxlength="1024" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('有效性')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="validStatus" dictType="guest_status" multiple="false" blankOption="true" class="form-control" 
								onchange="validConsum(this)"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注信息')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control" readonly="true"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
function validConsum(){
	var v = $('#validStatus').val();
	if(v == '1'){
		$('#consumDiv').show();
	} else {
		$('#consumDiv').hide();
	}
}
validConsum();
</script>